<!DOCTYPE html>
<html lang=zh>
<head>
    <meta charset="utf-8">
    
    <title>Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法) | 程序猿</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="==前文==，Quartz中迭代后，变化很大，让我走了很多的误区，这里简单解释一点，希望大家可以跳过误区，建议大家从下往上读（希望对大家有点帮助），我是一只爱分享的小菜鸟


JobDetail和Trigger和Schedule都是接口，统统不能new

1.如果只是执行一些自定义的类，其实使用SpringBoot的自带的任务就可以完成，简单的不能想象。这个可以看-&amp;gt;我的另一篇Spring">
<meta property="og:type" content="article">
<meta property="og:title" content="Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)">
<meta property="og:url" content="http://yoursite.com/2016/08/27/Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)/index.html">
<meta property="og:site_name" content="程序猿">
<meta property="og:description" content="==前文==，Quartz中迭代后，变化很大，让我走了很多的误区，这里简单解释一点，希望大家可以跳过误区，建议大家从下往上读（希望对大家有点帮助），我是一只爱分享的小菜鸟


JobDetail和Trigger和Schedule都是接口，统统不能new

1.如果只是执行一些自定义的类，其实使用SpringBoot的自带的任务就可以完成，简单的不能想象。这个可以看-&amp;gt;我的另一篇Spring">
<meta property="og:updated_time" content="2017-02-24T15:32:38.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)">
<meta name="twitter:description" content="==前文==，Quartz中迭代后，变化很大，让我走了很多的误区，这里简单解释一点，希望大家可以跳过误区，建议大家从下往上读（希望对大家有点帮助），我是一只爱分享的小菜鸟


JobDetail和Trigger和Schedule都是接口，统统不能new

1.如果只是执行一些自定义的类，其实使用SpringBoot的自带的任务就可以完成，简单的不能想象。这个可以看-&amp;gt;我的另一篇Spring">
    

    
        <link rel="alternate" href="/" title="程序猿" type="application/atom+xml" />
    

    

    <link rel="stylesheet" href="/libs/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/libs/open-sans/styles.css">
    <link rel="stylesheet" href="/libs/source-code-pro/styles.css">

    <link rel="stylesheet" href="/css/style.css">

    <script src="/libs/jquery/2.1.3/jquery.min.js"></script>
    
    
        <link rel="stylesheet" href="/libs/lightgallery/css/lightgallery.min.css">
    
    
        <link rel="stylesheet" href="/libs/justified-gallery/justifiedGallery.min.css">
    
    
    
    


</head>

<body>
    <div id="container">
        <header id="header">
    <div id="header-main" class="header-inner">
        <div class="outer">
            <a href="/" id="logo">
                <i class="logo"></i>
                <span class="site-title">程序猿</span>
            </a>
            <nav id="main-nav">
                
                    <a class="main-nav-link" href="http://chinesszz.oschina.io/">主页</a>
                
                    <a class="main-nav-link" href="/archives">档案</a>
                
                    <a class="main-nav-link" href="/archives">分类</a>
                
                    <a class="main-nav-link" href="/archives">标签</a>
                
                    <a class="main-nav-link" href="/关于我">关于我</a>
                
            </nav>
            
                
                <nav id="sub-nav">
                    <div class="profile" id="profile-nav">
                        <a id="profile-anchor" href="javascript:;">
                            <img class="avatar" src="/css/images/avatar.png" />
                            <i class="fa fa-caret-down"></i>
                        </a>
                    </div>
                </nav>
            
            <div id="search-form-wrap">

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
        <button type="submit" class="search-form-submit"></button>
    </form>
    <div class="ins-search">
    <div class="ins-search-mask"></div>
    <div class="ins-search-container">
        <div class="ins-input-wrapper">
            <input type="text" class="ins-search-input" placeholder="想要查找什么..." />
            <span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/',
        CONTENT_URL: '/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>
<script src="/js/insight.js"></script>

</div>
        </div>
    </div>
    <div id="main-nav-mobile" class="header-sub header-inner">
        <table class="menu outer">
            <tr>
                
                    <td><a class="main-nav-link" href="http://chinesszz.oschina.io/">主页</a></td>
                
                    <td><a class="main-nav-link" href="/archives">档案</a></td>
                
                    <td><a class="main-nav-link" href="/archives">分类</a></td>
                
                    <td><a class="main-nav-link" href="/archives">标签</a></td>
                
                    <td><a class="main-nav-link" href="/关于我">关于我</a></td>
                
                <td>
                    
    <div class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
    </div>

                </td>
            </tr>
        </table>
    </div>
</header>

        <div class="outer">
            
                

<aside id="profile">
    <div class="inner profile-inner">
        <div class="base-info profile-block">
            <img id="avatar" src="/css/images/avatar.png" />
            <h2 id="name">刘鑫</h2>
            <h3 id="title">一个热爱生活喜欢技术的程序猿</h3>
            <span id="location"><i class="fa fa-map-marker"></i>shanghai, China</span>
            <a id="follow" target="_blank" href="https://github.com/lxchinesszz">关注我</a>
        </div>
        <div class="article-info profile-block">
            <div class="article-info-block">
                25
                <span>文章</span>
            </div>
            <div class="article-info-block">
                19
                <span>标签</span>
            </div>
        </div>
        
        <div class="profile-block social-links">
            <table>
                <tr>
                    
                    
                    <td>
                        <a href="https://github.com/lxchinesszz" target="_blank" title="github" class=tooltip>
                            <i class="fa fa-github"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/" target="_blank" title="twitter" class=tooltip>
                            <i class="fa fa-twitter"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/" target="_blank" title="facebook" class=tooltip>
                            <i class="fa fa-facebook"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/" target="_blank" title="dribbble" class=tooltip>
                            <i class="fa fa-dribbble"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="http://weibo.com/u/5513970927?is_all=1" target="_blank" title="weibo" class=tooltip>
                            <i class="fa fa-weibo"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/" target="_blank" title="rss" class=tooltip>
                            <i class="fa fa-rss"></i>
                        </a>
                    </td>
                    
                </tr>
            </table>
        </div>
        
    </div>
</aside>

            
            <section id="main"><article id="Layout-Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)" class="article article-type-Layout" itemscope itemprop="blogPost">
    <div class="article-inner">
        
        
            <header class="article-header">
                
    
        <h1 class="article-title" itemprop="name">
            Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)
        </h1>
    

                
                    <div class="article-meta">
                        
    <div class="article-date">
        <i class="fa fa-calendar"></i>
        <a href="/2016/08/27/Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)/">
            <time datetime="2016-08-26T16:00:00.000Z" itemprop="datePublished">2016-08-27</time>
        </a>
    </div>


                        
    <div class="article-category">
    	<i class="fa fa-folder"></i>
        <a class="article-category-link" href="/categories/Spring-Boot实战/">Spring Boot实战</a>
    </div>

                        
    <div class="article-tag">
        <i class="fa fa-tag"></i>
        <a class="tag-link" href="/tags/Spring整合Quartz2-1-1/">Spring整合Quartz2.1.1</a>
    </div>

                    </div>
                
            </header>
        
        
        <div class="article-entry" itemprop="articleBody">
        
            
            <blockquote>
<p>==前文==，Quartz中迭代后，变化很大，让我走了很多的误区，这里简单解释一点，希望大家可以跳过误区，建议大家从下往上读（希望对大家有点帮助），我是一只爱分享的小菜鸟</p>
</blockquote>
<ul>
<li>JobDetail和Trigger和Schedule都是接口，统统不能new</li>
</ul>
<h5 id="1-如果只是执行一些自定义的类，其实使用SpringBoot的自带的任务就可以完成，简单的不能想象。这个可以看-gt-我的另一篇SpringBoot原生定时任务解析。"><a href="#1-如果只是执行一些自定义的类，其实使用SpringBoot的自带的任务就可以完成，简单的不能想象。这个可以看-gt-我的另一篇SpringBoot原生定时任务解析。" class="headerlink" title="1.如果只是执行一些自定义的类，其实使用SpringBoot的自带的任务就可以完成，简单的不能想象。这个可以看-&gt;我的另一篇SpringBoot原生定时任务解析。"></a>1.如果只是执行一些自定义的类，其实使用SpringBoot的自带的任务就可以完成，简单的不能想象。这个可以看-&gt;我的另一篇SpringBoot原生定时任务解析。</h5><h5 id="2-如果要是要动态的执行一些有Spring管理的bean，可能要稍微费点功夫了，网上有很多的教程，那部分都是xml形式配置的，本人菜鸟一枚（十分迷惑），十分不喜欢xml配置，看着眼花，当程序读取的时候还是要解析java对象来执行的，那么为何不直接配置成配置类呢？这个问题先方下，以后会详细解释如何使用Spring-Boot配置类。"><a href="#2-如果要是要动态的执行一些有Spring管理的bean，可能要稍微费点功夫了，网上有很多的教程，那部分都是xml形式配置的，本人菜鸟一枚（十分迷惑），十分不喜欢xml配置，看着眼花，当程序读取的时候还是要解析java对象来执行的，那么为何不直接配置成配置类呢？这个问题先方下，以后会详细解释如何使用Spring-Boot配置类。" class="headerlink" title="2.如果要是要动态的执行一些有Spring管理的bean，可能要稍微费点功夫了，网上有很多的教程，那部分都是xml形式配置的，本人菜鸟一枚（十分迷惑），十分不喜欢xml配置，看着眼花，当程序读取的时候还是要解析java对象来执行的，那么为何不直接配置成配置类呢？这个问题先方下，以后会详细解释如何使用Spring Boot配置类。"></a>2.如果要是要动态的执行一些有Spring管理的bean，可能要稍微费点功夫了，网上有很多的教程，那部分都是xml形式配置的，本人菜鸟一枚（十分迷惑），十分不喜欢xml配置，看着眼花，当程序读取的时候还是要解析java对象来执行的，那么为何不直接配置成配置类呢？这个问题先方下，以后会详细解释如何使用Spring Boot配置类。</h5><h1 id="开始代码展示"><a href="#开始代码展示" class="headerlink" title="开始代码展示"></a>开始代码展示</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div></pre></td><td class="code"><pre><div class="line">    //job是一个接口，当定时任务执行的时候，就要运行这个方法，那么可以推测</div><div class="line">    JobExecutionContext这个对象中包含了我们可能使用的关于这个定时任务的所有细节，请看代码</div><div class="line">        </div><div class="line">public interface Job &#123;</div><div class="line">    void execute(JobExecutionContext var1) throws JobExecutionException;</div><div class="line">&#125;</div><div class="line"></div><div class="line">/**</div><div class="line"> * Created by liuxin on 16/12/21.</div><div class="line"> * 方案1：反射执行类和执行方法（不解析，没有用，刚开始走了误区，自己反射方法执行，大家尽量不要用）</div><div class="line"> * 方案2：读取bean（这个才是重点）</div><div class="line"> */</div><div class="line">public class ScheduledTasks implements Job &#123;</div><div class="line"></div><div class="line">    @Override</div><div class="line">    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException &#123;</div><div class="line">        System.out.println(&quot;------进入定时方法区域-------&quot;);</div><div class="line">        try &#123;</div><div class="line">            ConfigurableApplicationContext cac = (ConfigurableApplicationContext) jobExecutionContext.getJobDetail().getJobDataMap().get(&quot;ConfigurableApplicationContext&quot;);</div><div class="line">            HelloService helloService = (HelloService) cac.getBean(&quot;helloService&quot;);</div><div class="line">            helloService.hh();</div><div class="line">        &#125; catch (Exception e) &#123;</div><div class="line">            </div><div class="line">        &#125;</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<blockquote>
<p>上面的代码中看到这个JobExecutionContext可以得到JobDetail，而这个JobDetail对象是我们自己创建的用来详细介绍我们定时任务的，也就是我们要执行的方法的详细在这个里存放，<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">jobDetail.getJobDataMap().put(&quot;ConfigurableApplicationContext&quot;,cac);</div><div class="line">这个是我们在main方法中测试时候，提前放进去，的在执行execute方法时候，取到的上下文对象，用来得到bean的这么说是不是很清楚了？</div><div class="line">接着看代码</div></pre></td></tr></table></figure></p>
<p>测试的bean对象<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">@Service</div><div class="line">public class HelloService &#123;</div><div class="line">    static int i=0;</div><div class="line">    public void hh()&#123;</div><div class="line">        System.out.println(++i);</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>为了证明这个bean在上下文中，我们打印一下，上下文中的所有的bean</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div></pre></td><td class="code"><pre><div class="line">@SpringBootApplication</div><div class="line">public class TestQuartzApplication &#123;</div><div class="line"></div><div class="line">    public static void main(String[] args) throws Exception &#123;</div><div class="line">        ConfigurableApplicationContext cac = SpringApplication.run(TestQuartzApplication.class, args);</div><div class="line">        String[] names = cac.getBeanDefinitionNames();</div><div class="line">        Arrays.asList(names).forEach(name -&gt; System.out.println(name));//打印bean 可以看到helloService在倒数3</div><div class="line"></div><div class="line">    &#125;</div><div class="line">&#125;</div><div class="line"></div><div class="line"></div><div class="line">  .   ____          _            __ _ _</div><div class="line"> /\\ / ___&apos;_ __ _ _(_)_ __  __ _ \ \ \ \</div><div class="line">( ( )\___ | &apos;_ | &apos;_| | &apos;_ \/ _` | \ \ \ \</div><div class="line"> \\/  ___)| |_)| | | | | || (_| |  ) ) ) )</div><div class="line">  &apos;  |____| .__|_| |_|_| |_\__, | / / / /</div><div class="line"> =========|_|==============|___/=/_/_/_/</div><div class="line"> :: Spring Boot ::        (v1.4.2.RELEASE)</div><div class="line"></div><div class="line">org.springframework.context.annotation.internalConfigurationAnnotationProcessor</div><div class="line">org.springframework.context.annotation.internalAutowiredAnnotationProcessor</div><div class="line">org.springframework.context.annotation.internalRequiredAnnotationProcessor</div><div class="line">org.springframework.context.annotation.internalCommonAnnotationProcessor</div><div class="line">org.springframework.context.event.internalEventListenerProcessor</div><div class="line">org.springframework.context.event.internalEventListenerFactory</div><div class="line">testQuartzApplication</div><div class="line">org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory</div><div class="line">org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor</div><div class="line">org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor</div><div class="line">helloService</div><div class="line">redisConfig</div><div class="line">jedis</div></pre></td></tr></table></figure>
<blockquote>
<p>那么现在的任务就是把，这个上下文对象防盗JobDetil的map中，2.2.1的区别来了，不在是一起new的jobDetail了,由JobBuilder和TriggerBuilder构建<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div></pre></td><td class="code"><pre><div class="line">@SpringBootApplication</div><div class="line">@EnableScheduling</div><div class="line">public class TestQuartzApplication &#123;</div><div class="line"></div><div class="line">    public static void main(String[] args) throws Exception &#123;</div><div class="line">        ConfigurableApplicationContext cac = SpringApplication.run(TestQuartzApplication.class, args);</div><div class="line">        String[] names = cac.getBeanDefinitionNames();</div><div class="line">        Arrays.asList(names).forEach(name -&gt; System.out.println(name));//打印bean</div><div class="line">        SchedulerFactory schedulerFactory = new StdSchedulerFactory();</div><div class="line">        Scheduler scheduler = schedulerFactory.getScheduler();</div><div class="line">        JobDetail jobDetail = JobBuilder.newJob(ScheduledTasks.class).withIdentity(&quot;testkey&quot;, &quot;testvalue&quot;).withDescription(&quot;一个测试的类&quot;).build();</div><div class="line">        jobDetail.getJobDataMap().put(&quot;ConfigurableApplicationContext&quot;,cac);//重点是这句话</div><div class="line">        Trigger trigger = TriggerBuilder.newTrigger().startNow().withSchedule(CronScheduleBuilder.cronSchedule(&quot;0/1 * * * * ?&quot;)).startNow().build();</div><div class="line">        scheduler.scheduleJob(jobDetail,trigger);</div><div class="line">        scheduler.start();</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
</blockquote>

        
        </div>
        <footer class="article-footer">
            <div class="share-container">



</div>

    <a data-url="http://yoursite.com/2016/08/27/Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)/" data-id="cizk115fh001kjj8zhqrp54u0" class="article-share-link"><i class="fa fa-share"></i>分享到</a>
<script>
    (function ($) {
        // Prevent duplicate binding
        if (typeof(__SHARE_BUTTON_BINDED__) === 'undefined' || !__SHARE_BUTTON_BINDED__) {
            __SHARE_BUTTON_BINDED__ = true;
        } else {
            return;
        }
        $('body').on('click', function() {
            $('.article-share-box.on').removeClass('on');
        }).on('click', '.article-share-link', function(e) {
            e.stopPropagation();

            var $this = $(this),
                url = $this.attr('data-url'),
                encodedUrl = encodeURIComponent(url),
                id = 'article-share-box-' + $this.attr('data-id'),
                offset = $this.offset(),
                box;

            if ($('#' + id).length) {
                box = $('#' + id);

                if (box.hasClass('on')){
                    box.removeClass('on');
                    return;
                }
            } else {
                var html = [
                    '<div id="' + id + '" class="article-share-box">',
                        '<input class="article-share-input" value="' + url + '">',
                        '<div class="article-share-links">',
                            '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="fa fa-twitter article-share-twitter" target="_blank" title="Twitter"></a>',
                            '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="fa fa-facebook article-share-facebook" target="_blank" title="Facebook"></a>',
                            '<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="fa fa-pinterest article-share-pinterest" target="_blank" title="Pinterest"></a>',
                            '<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="fa fa-google article-share-google" target="_blank" title="Google+"></a>',
                        '</div>',
                    '</div>'
                ].join('');

              box = $(html);

              $('body').append(box);
            }

            $('.article-share-box.on').hide();

            box.css({
                top: offset.top + 25,
                left: offset.left
            }).addClass('on');

        }).on('click', '.article-share-box', function (e) {
            e.stopPropagation();
        }).on('click', '.article-share-box-input', function () {
            $(this).select();
        }).on('click', '.article-share-box-link', function (e) {
            e.preventDefault();
            e.stopPropagation();

            window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
        });
    })(jQuery);
</script>

            
    
        <a href="http://yoursite.com/2016/08/27/Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)/#comments" class="article-comment-link ds-thread-count" data-thread-key="http://yoursite.com/2016/08/27/Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)/">评论</a>
    

        </footer>
    </div>
    
        
<nav id="article-nav">
    
        <a href="/2016/10/11/Spring Cloud初步理解/" id="article-nav-newer" class="article-nav-link-wrap">
            <strong class="article-nav-caption">上一篇</strong>
            <div class="article-nav-title">
                
                    Spring Cloud初步理解
                
            </div>
        </a>
    
    
        <a href="/2016/08/23/SpringBoot整合Quartz-动态读取任务执行(2.2.1)/" id="article-nav-older" class="article-nav-link-wrap">
            <strong class="article-nav-caption">下一篇</strong>
            <div class="article-nav-title">SpringBoot整合Quartz-动态读取任务执行(2.2.1)</div>
        </a>
    
</nav>


    
</article>


    
    <section id="comments">
    
        
    <div class="ds-thread" data-thread-key="2016/08/27/Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)/" data-title="Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)" data-url="http://yoursite.com/2016/08/27/Spring整合Quartz2.1.1(执行中，得到application上下文，执行bean方法)/"></div>
    <style>
        #ds-thread #ds-reset .ds-textarea-wrapper {
            background: none;
        }
        #ds-reset .ds-avatar img {
            box-shadow: none;
        }
        #ds-reset .ds-gradient-bg {
            background: #f7f7f7;
        }
        #ds-thread #ds-reset li.ds-tab a {
            border-radius: 3px;
        }
        #ds-thread #ds-reset .ds-post-button {
            color: white;
            border: none;
            box-shadow: none;
            background: #d32;
            text-shadow: none;
            font-weight: normal;
            font-family: 'Microsoft Yahei';
        }
        #ds-thread #ds-reset .ds-post-button:hover {
            color: white;
            background: #DE594C;
        }
        #ds-thread #ds-reset .ds-post-button:active {
            background: #d32;
        }
        #ds-smilies-tooltip ul.ds-smilies-tabs li a.ds-current {
            color: white;
            background: #d32;
            box-shadow: none;
            text-shadow: none;
            font-weight: normal;
        }
    </style>

    
    </section>

</section>
            
                <aside id="sidebar">
   
        
    <div class="widget-wrap">
        <h3 class="widget-title">最新文章</h3>
        <div class="widget">
            <ul id="recent-post" class="">
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/05/17/CPU-bound(计算密集型) 和IO bound(IO密集型)、进程vs线程/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/categories/服务器/">服务器</a></p>
                            <p class="item-title"><a href="/2017/05/17/CPU-bound(计算密集型) 和IO bound(IO密集型)、进程vs线程/" class="title">CPU-bound(计算密集型) 和IO bound(IO密集型)、进程vs线程</a></p>
                            <p class="item-date"><time datetime="2017-05-16T16:00:00.000Z" itemprop="datePublished">2017-05-17</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/04/27/Spring Boot中使用@Async实现异步调用/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/categories/Spring-Boot实战/">Spring Boot实战</a></p>
                            <p class="item-title"><a href="/2017/04/27/Spring Boot中使用@Async实现异步调用/" class="title">Spring Boot中使用@Async实现异步调用</a></p>
                            <p class="item-date"><time datetime="2017-04-26T16:00:00.000Z" itemprop="datePublished">2017-04-27</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/01/28/线程数究竟设多少合理/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/categories/服务器/">服务器</a></p>
                            <p class="item-title"><a href="/2017/01/28/线程数究竟设多少合理/" class="title">线程数究竟设多少合理</a></p>
                            <p class="item-date"><time datetime="2017-01-27T16:00:00.000Z" itemprop="datePublished">2017-01-28</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/01/27/浅谈分布式与集群(未完待续)/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/categories/系统架构/">系统架构</a></p>
                            <p class="item-title"><a href="/2017/01/27/浅谈分布式与集群(未完待续)/" class="title">浅谈分布式与集群(未完待续)</a></p>
                            <p class="item-date"><time datetime="2017-01-26T16:00:00.000Z" itemprop="datePublished">2017-01-27</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/01/11/Spring Cloud系列五 之 服务网关/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/categories/Spring-Cloud/">Spring Cloud</a></p>
                            <p class="item-title"><a href="/2017/01/11/Spring Cloud系列五 之 服务网关/" class="title">Spring Cloud系列五 之 服务网关</a></p>
                            <p class="item-date"><time datetime="2017-01-10T16:00:00.000Z" itemprop="datePublished">2017-01-11</time></p>
                        </div>
                    </li>
                
            </ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">分类</h3>
        <div class="widget">
            <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Java命名规范/">Java命名规范</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Spring-Boot实战/">Spring Boot实战</a><span class="category-list-count">13</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Spring-Cloud/">Spring Cloud</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/服务器/">服务器</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/服务器搭建/">服务器搭建</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/系统架构/">系统架构</a><span class="category-list-count">1</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">归档</h3>
        <div class="widget">
            <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/05/">五月 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/04/">四月 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/01/">一月 2017</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/12/">十二月 2016</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/11/">十一月 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/10/">十月 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/">八月 2016</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/07/">七月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/06/">六月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/05/">五月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">一月 2016</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/01/">一月 2015</a><span class="archive-list-count">1</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签</h3>
        <div class="widget">
            <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Java命名规范/">Java命名规范</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Maven/">Maven</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Spring-Boot中使用-Async实现异步调用/">Spring Boot中使用@Async实现异步调用</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Spring-Boot注解/">Spring Boot注解</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Spring-Cloud/">Spring Cloud</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/SpringBoot原生定时任务解析/">SpringBoot原生定时任务解析</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/SpringBoot在启动类配置端口号/">SpringBoot在启动类配置端口号</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/SpringBoot拦截器/">SpringBoot拦截器</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/SpringBoot配置视图/">SpringBoot配置视图</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Spring整合Quartz2-1-1/">Spring整合Quartz2.1.1</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/优化方案/">优化方案</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/分布式与集群/">分布式与集群</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/动态读取任务执行/">动态读取任务执行</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/启动环境/">启动环境</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/整合定时任务/">整合定时任务</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/服务器/">服务器</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/服务器搭建/">服务器搭建</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/计算/">计算</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/配置文件加载/">配置文件加载</a><span class="tag-list-count">1</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签云</h3>
        <div class="widget tagcloud">
            <a href="/tags/Java命名规范/" style="font-size: 10px;">Java命名规范</a> <a href="/tags/Maven/" style="font-size: 10px;">Maven</a> <a href="/tags/Spring-Boot中使用-Async实现异步调用/" style="font-size: 10px;">Spring Boot中使用@Async实现异步调用</a> <a href="/tags/Spring-Boot注解/" style="font-size: 10px;">Spring Boot注解</a> <a href="/tags/Spring-Cloud/" style="font-size: 20px;">Spring Cloud</a> <a href="/tags/SpringBoot原生定时任务解析/" style="font-size: 10px;">SpringBoot原生定时任务解析</a> <a href="/tags/SpringBoot在启动类配置端口号/" style="font-size: 10px;">SpringBoot在启动类配置端口号</a> <a href="/tags/SpringBoot拦截器/" style="font-size: 10px;">SpringBoot拦截器</a> <a href="/tags/SpringBoot配置视图/" style="font-size: 10px;">SpringBoot配置视图</a> <a href="/tags/Spring整合Quartz2-1-1/" style="font-size: 10px;">Spring整合Quartz2.1.1</a> <a href="/tags/优化方案/" style="font-size: 10px;">优化方案</a> <a href="/tags/分布式与集群/" style="font-size: 10px;">分布式与集群</a> <a href="/tags/动态读取任务执行/" style="font-size: 10px;">动态读取任务执行</a> <a href="/tags/启动环境/" style="font-size: 10px;">启动环境</a> <a href="/tags/整合定时任务/" style="font-size: 10px;">整合定时任务</a> <a href="/tags/服务器/" style="font-size: 10px;">服务器</a> <a href="/tags/服务器搭建/" style="font-size: 15px;">服务器搭建</a> <a href="/tags/计算/" style="font-size: 10px;">计算</a> <a href="/tags/配置文件加载/" style="font-size: 10px;">配置文件加载</a>
        </div>
    </div>

    
        
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">链接</h3>
        <div class="widget">
            <ul>
                
                    <li>
                        <a href="http://www.jianshu.com/u/e210c8fa704f">简书</a>
                    </li>
                
                    <li>
                        <a href="http://blog.csdn.net/message_lx/article/details/56674087">CSDN</a>
                    </li>
                
                    <li>
                        <a href="https://www.zhihu.com/people/chinesszz/activities">知乎</a>
                    </li>
                
                    <li>
                        <a href="https://my.oschina.net/chinesszz/blog">开源中国</a>
                    </li>
                
                    <li>
                        <a href="https://lxchinesszz.github.io/">GITHUB博客</a>
                    </li>
                
            </ul>
        </div>
    </div>


    
    <div id="toTop" class="fa fa-angle-up"></div>
</aside>
            
        </div>
        <footer id="footer">
    <div class="outer">
        <div id="footer-info" class="inner">
            &copy; 2017<br>
            <a href="http://www.jianshu.com/u/e210c8fa704f" target="_blank">简书</a>. by <a href="https://github.com/lxchinesszz">Liuxin</a>
        </div>
    </div>
</footer>
        
    
    <script type="text/javascript">
    var duoshuoQuery = {short_name:'lxchinesszz'};
    (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0]
    || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>



    
        <script src="/libs/lightgallery/js/lightgallery.min.js"></script>
        <script src="/libs/lightgallery/js/lg-thumbnail.min.js"></script>
        <script src="/libs/lightgallery/js/lg-pager.min.js"></script>
        <script src="/libs/lightgallery/js/lg-autoplay.min.js"></script>
        <script src="/libs/lightgallery/js/lg-fullscreen.min.js"></script>
        <script src="/libs/lightgallery/js/lg-zoom.min.js"></script>
        <script src="/libs/lightgallery/js/lg-hash.min.js"></script>
        <script src="/libs/lightgallery/js/lg-share.min.js"></script>
        <script src="/libs/lightgallery/js/lg-video.min.js"></script>
    
    
        <script src="/libs/justified-gallery/jquery.justifiedGallery.min.js"></script>
    



<!-- Custom Scripts -->
<script src="/js/main.js"></script>

    </div>
</body>
</html>